home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIAppStartup.idl < prev    next >
Text File  |  2006-05-08  |  4KB  |  120 lines

  1. /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is Mozilla Communicator client code, copied from
  16.  * xpfe/appshell/public/nsIAppShellService.idl
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Netscape Communications Corporation.
  20.  * Portions created by the Initial Developer are Copyright (C) 1999
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *   Benjamin Smedberg <benjamin@smedbergs.us>
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  28.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39.  
  40. #include "nsISupports.idl"
  41.  
  42. interface nsICmdLineService;
  43.  
  44. [scriptable, uuid(e9b0f89b-0529-4d96-98a8-eb5b2b9a8383)]
  45. interface nsIAppStartup : nsISupports
  46. {
  47.     /**
  48.      * Create the hidden window.
  49.      */
  50.     void createHiddenWindow();
  51.  
  52.     /**
  53.      * Runs an application event loop: normally the main event pump which
  54.      * defines the lifetime of the application.
  55.      *
  56.      * @returnCode NS_SUCCESS_RESTART_APP
  57.      *             This return code indicates that the application should be
  58.      *             restarted because quit was called with the eRestart flag.
  59.      */
  60.     void run();
  61.  
  62.     /**
  63.      * During application startup (and at other times!) we may temporarily
  64.      * encounter a situation where all application windows will be closed
  65.      * but we don't want to take this as a signal to quit the app. Bracket
  66.      * the code where the last window could close with these.
  67.      * (And at application startup, on platforms that don't normally quit
  68.      * when the last window has closed, call Enter once, but not Exit)
  69.      */
  70.     void enterLastWindowClosingSurvivalArea();
  71.     void exitLastWindowClosingSurvivalArea();
  72.  
  73.     /**
  74.      * The following flags may be passed as the aMode parameter to the quit
  75.      * method.  One and only one of the "Quit" flags must be specified.  The
  76.      * eRestart flag may be bit-wise combined with one of the "Quit" flags to
  77.      * cause the application to restart after it quits.
  78.      */
  79.  
  80.     /**
  81.      * Attempt to quit if all windows are closed.
  82.      */
  83.     const PRUint32 eConsiderQuit = 0x01;
  84.  
  85.     /**
  86.      * Try to close all windows, then quit if successful.
  87.      */
  88.     const PRUint32 eAttemptQuit = 0x02;
  89.  
  90.     /**
  91.      * Quit, damnit!
  92.      */
  93.     const PRUint32 eForceQuit = 0x03;
  94.  
  95.     /**
  96.      * Restart the application after quitting.  The application will be
  97.      * restarted with the same profile and an empty command line.
  98.      */
  99.     const PRUint32 eRestart = 0x10; 
  100.  
  101.     /**
  102.      * Exit the event loop, and shut down the app.
  103.      *
  104.      * @param aMode
  105.      *        This parameter modifies how the app is shutdown, and it is
  106.      *        constructed from the constants defined above.
  107.      */
  108.     void quit(in PRUint32 aMode);
  109. };
  110.  
  111. %{C++
  112. /**
  113.  * This success code may be returned by nsIAppStartup::Run to indicate that the
  114.  * application should be restarted.  This condition corresponds to the case in
  115.  * which nsIAppStartup::Quit was called with the eRestart flag.
  116.  */
  117. #define NS_SUCCESS_RESTART_APP \
  118.     NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 1)
  119. %}
  120.